package com.share.example.spider.pipeline;

import com.share.example.spider.model.db.Fund;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import us.codecraft.webmagic.ResultItems;
import us.codecraft.webmagic.Task;
import us.codecraft.webmagic.pipeline.Pipeline;

/**
 * @author 01401061 - 孙艳强
 * @date 2020/10/28 15:29
 */
@Slf4j
@Component
public class FundPipeline implements Pipeline {

    @Override
    public void process(ResultItems resultItems, Task task) {
        int status = 0;
        Fund data = resultItems.get(Fund.class.getName());
        if (data == null) {
            log.info("爬取为空");
            return;
        }

        log.info("爬取到的条数:" + status);
    }
}
